package com.ctd.springframework.core;

import com.ctd.springframework.util.Assert;

/**
 * NamedThreadLocal
 *
 * @author chentudong
 * @time 2019/3/24 21:57
 */
public class NamedThreadLocal<T> extends ThreadLocal<T> {
    private final String name;

    public NamedThreadLocal(String name) {
        Assert.hasText(name, "Name must not be empty");
        this.name = name;
    }

    @Override
    public String toString() {
        return this.name;
    }
}
